(function(){
    var SERVER = {
        url:'http://127.0.0.1'
    }
    var DOM = {
        gameContainer: document.getElementById('game-container')
    }
    var canvas = document.createElement('canvas');
        canvas.width = 400;
        canvas.height = 400;
        canvas.style.border = '1px solid black';
    var ctx = canvas.getContext('2d');
    var selfPlayer = new Player({
        mapSize:{width:400,height:400}
    });

    initGame();
    function initGame(){
        DOM.gameContainer.appendChild(canvas);

        console.log(selfPlayer);
        renderMap();
    }
    function renderMap(){
        setInterval(function(){
            ctx.fillStyle="#000000";
            ctx.clearRect(0,0,canvas.width,canvas.height);
            ctx.fillRect(0,0,canvas.width,canvas.height);

            selfPlayer.draw(ctx);
        },1000/30);
    }
})();